package myapps.ttclient.protocol.message;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.GlobalVariables;
import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;


public class FileExploreRequestMessage extends TTClientMessage
{
	public String temporaryKey = "";

	public String directory;
	public String file;

	public FileExploreRequestMessage(String temporaryKey, String directory, String file)
	{
		this.temporaryKey = temporaryKey;
		this.directory = directory;
		this.file = file;
	}

	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{
		throw new IOException("NotImplementedException");
	}

	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException
	{
		dos.writeByte(FILE_EXPLORE_REQUEST);
		dos.writeInt(GlobalVariables.NO_LENGTH_CODE);
		
		Helper.WriteStringToDataOutputStream(dos, temporaryKey);
		
		Helper.WriteStringToDataOutputStream(dos, this.directory);
		Helper.WriteStringToDataOutputStream(dos, this.file);
		
	}
}
